Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Function |saturating_to_u16

std/conv::|saturating_to_u16


Usage

|saturating_to_u16<T>(value)

Generics

◻ T: SaturatingToU16

Parameters

↳ value: T

Return

u16


Turns data into u16, saturating if needed.

This function makes a saturating and infaillible conversion to u16. If incoming data represents something out of bounds for u16, then the resulting value is set to minimum or maximum, depending what is the closest to truth.